package com.itheima.health.h5.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.service.SetmealService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SetmealController {

    @Reference
    private SetmealService setmealService;

    @GetMapping("setmeal/findAllSetmeal")
    public Result findAll(){
        return  new Result(setmealService.list());
    }


    @GetMapping("setmeal/findSetMealDetailById/{id}")
    public Result findSetMealDetailById(@PathVariable("id") int id){
        return  new Result(setmealService.findSetMealDetailById(id));
    }
}
